#!/usr/bin/python
# -*- coding: utf-8 -*-

import Ice, sys, os
import AMSI, DFI, MTSI, AgentFactoryI, AgentI, PropertyServiceI
from AMSI import *
from DFI import *
from MTSI import *
from AgentFactoryI import *
from AgentI import *
from PropertyServiceI import *

class AgentFactoryServer (Ice.Application):

    def run (self, argv):
        self.shutdownOnInterrupt()
        adapter = self.communicator().createObjectAdapter('AgentFactoryAdapter')
        adapter.activate()

        props = self.communicator().getProperties()
        objId = 'AgentFactory.' + str(props.getProperty('number'))

        adapter.add(AgentFactoryI(),
                    self.communicator().stringToIdentity(objId))
        self.communicator().waitForShutdown()

        return 0

AgentFactoryServer().main(sys.argv)
